package leetcode.array;

/**
 * @author wangmaolin1
 * @date 2024/3/11 22:03
 */
public class _283 {
    public void moveZeroes(int[] nums) {
        if (nums==null ||nums.length<=0){
            return;
        }
        int res=-1;
        int p=0;
        while (p<nums.length){
            if (nums[p]==0){
                p++;
                continue;
            }
            nums[++res]=nums[p];
        }
        res=res+1;
        while (res<nums.length){
            nums[res]=0;
        }

    }
}
